package main.java.single;

// 懒汉式单例
public class LazyMan {
    //构造器私有
    private LazyMan(){

    }

    private static LazyMan lazyMan;
    //多线程情况下 会存在问题
    public static LazyMan getInstance(){
        if (lazyMan == null){
            lazyMan = new LazyMan();
        }
        return lazyMan;
    }
}
